package com.fast.cms.model.article;

import java.io.Serializable;
import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.persistence.Transient;

import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import com.fasterxml.jackson.annotation.JsonFormat;

@Entity
@Table(name = "t_cms_BatchDataInfo")
@DynamicInsert(true)
@DynamicUpdate(true)
public class BatchDataInfo implements Serializable {

	private static final long serialVersionUID = -4967731498855130634L;

	@Id
	@GeneratedValue(strategy = GenerationType.AUTO)
	@Column(name = "id", unique = true, nullable = false, length = 10)
	private int id = 0;
	@Column(name = "uuid", length = 64)
	private String uuid = "";

	// ============================基本信息===开始======================================
	@Column(name = "batch_desc", columnDefinition = ("varchar(64) comment '批次说明'"))
	private String batchDesc = "";
	@Column(name = "file_name", columnDefinition = ("varchar(64) comment '文件名'"))
	private String fileName = "";
	@Column(name = "data_type", columnDefinition = ("varchar(64) comment '数据类型'"))
	private String dataType = "";
	@Column(name = "is_download", columnDefinition = ("int(2) comment '是否下载过'"))
	private int isDownload = 0;
	@Column(name = "batch_Count", columnDefinition = ("int(8) comment '当前批次数量'"))
	private int batchCount;
	@Column(name = "url_id", columnDefinition = ("varchar(256) comment '当前批次对应的地址ID'"))
	private String urlId;

	// ==================创建与编辑信息======================
	// 操作信息
	@Column(name = "editor_id", columnDefinition = ("int(10) comment '编辑人ID'"))
	private int editorId = 0;// 编辑人Id
	@Column(name = "editor_name", columnDefinition = ("varchar(64) comment '编辑人'"))
	private String editorName = "";// 编辑人
	@Column(name = "edit_time")
	@Temporal(TemporalType.TIMESTAMP)
	private Date editTime;// 编辑时间
	@Column(name = "creater_id", columnDefinition = ("int(10) comment '创建人id'"))
	private int createrId = 0;// 编辑人Id
	@Column(name = "creater", columnDefinition = ("varchar(64) comment '创建人'"))
	private String creater = "";// 编辑人
	@Column(name = "create_time")
	@Temporal(TemporalType.TIMESTAMP)
	private Date createTime;
	@Column(name = "delete_flag", columnDefinition = ("int(1) comment '删除标识'"))
	private int deleteFlag = 0;// 默认为不删除，1为删除
	
	
	

	public int getId() {
		return id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public String getUuid() {
		return uuid;
	}

	public void setUuid(String uuid) {
		this.uuid = uuid;
	}

	public String getBatchDesc() {
		return batchDesc;
	}

	public void setBatchDesc(String batchDesc) {
		this.batchDesc = batchDesc;
	}

	public String getFileName() {
		return fileName;
	}

	public void setFileName(String fileName) {
		this.fileName = fileName;
	}

	public String getDataType() {
		return dataType;
	}

	public void setDataType(String dataType) {
		this.dataType = dataType;
	}

	public int getIsDownload() {
		return isDownload;
	}

	public void setIsDownload(int isDownload) {
		this.isDownload = isDownload;
	}

	public int getEditorId() {
		return editorId;
	}

	public void setEditorId(int editorId) {
		this.editorId = editorId;
	}

	public String getEditorName() {
		return editorName;
	}

	public void setEditorName(String editorName) {
		this.editorName = editorName;
	}

	@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss",timezone="GMT+8")
	public Date getEditTime() {
		return editTime;
	}

	public void setEditTime(Date editTime) {
		this.editTime = editTime;
	}

	public int getCreaterId() {
		return createrId;
	}

	public void setCreaterId(int createrId) {
		this.createrId = createrId;
	}

	public String getCreater() {
		return creater;
	}

	public void setCreater(String creater) {
		this.creater = creater;
	}

	@JsonFormat(pattern = "yyyy年MM月dd日",timezone="GMT+8")
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	public int getDeleteFlag() {
		return deleteFlag;
	}

	public void setDeleteFlag(int deleteFlag) {
		this.deleteFlag = deleteFlag;
	}

	@Override
	public String toString() {
		return "{\"id\":\"" + id + "\", \"uuid\":\"" + uuid + "\", \"batchDesc\":\"" + batchDesc + "\", \"fileName\":\""
				+ fileName + "\", \"dataType\":\"" + dataType + "\", \"isDownload\":\"" + isDownload
				+ "\", \"batchCount\":\"" + batchCount + "\", \"urlId\":\"" + urlId + "\", \"editorId\":\"" + editorId
				+ "\", \"editorName\":\"" + editorName + "\", \"editTime\":\"" + editTime + "\", \"createrId\":\""
				+ createrId + "\", \"creater\":\"" + creater + "\", \"createTime\":\"" + createTime
				+ "\", \"deleteFlag\":\"" + deleteFlag + "\"}";
	}

	public int getBatchCount() {
		return batchCount;
	}

	public void setBatchCount(int batchCount) {
		this.batchCount = batchCount;
	}

	public String getUrlId() {
		return urlId;
	}

	public void setUrlId(String urlId) {
		this.urlId = urlId;
	}

}
